package desktop.local.pair.cooperate;

import pulpcore.Stage;
import pulpcore.scene.Scene2D;
import desktop.conf.key.KeyConfLeft;
import desktop.conf.key.KeyConfRight;
import desktop.core.bar.BarController;
import desktop.core.playfield.PlayFieldModel;
import desktop.core.playfield.PlayFieldViewDoubleBar;
import desktop.playerguide.scoreForm.ScoreGroup;

public class LocalPairCooperateScene extends Scene2D {
	private PlayFieldViewDoubleBar doubleBarPlayFieldView;
	private ScoreGroup scoreForm;

	@Override
	public void load() {
		scoreForm = new ScoreGroup();
		doubleBarPlayFieldView = new PlayFieldViewDoubleBar(0, 0, Stage
				.getWidth(), Stage.getHeight(), new PlayFieldModel(),
				new BarController(new KeyConfLeft()), new BarController(
						new KeyConfRight()));
		this.add(doubleBarPlayFieldView);
		add(scoreForm);
		scoreForm.setLocation(Stage.getWidth() - scoreForm.getW(), 0);
	}

	@Override
	public void update(int elapsedTime) {
		super.update(elapsedTime);
		scoreForm.setScore(doubleBarPlayFieldView.getPointsTotally());
	}
}
